<template>
  <div class="login" v-show="showLogin">
    <div class="login_in">
      <div class="box" v-show="isLogin">
        <div class="box_login">
          登陆
          <span @click="change">x</span>
        </div>
        <div class="box_in" v-show="isShow">
          <section class="tanxing">
            <img src="../assets/phone.png" alt="" width="125" height="220" />
            <div class="weixin">
              <h2>扫码登录</h2>
              <img src="../assets/erwei.png" alt="" height="130" width="130" />
              <p>使用<span>网易云一月APP</span>扫码登录</p>
            </div>
          </section>
          <div class="chose" @click="changeShow">选择其他登录模式</div>
        </div>
        <div class="user_phone" v-show="!isShow">
          <div class="user tanxing">
            <div class="user_l">
              <img src="../assets/userphone.png" alt="" width="224" />
              <div class="u_log" @click="isLogin = !isLogin">手机号登陆</div>
              <div class="u_get">注册</div>
            </div>
            <div class="user_r">
              <ul>
                <li><span></span>微信登录</li>
                <li><span></span>QQ登录</li>
                <li><span></span>微博登录</li>
                <li><span></span>网易邮箱账号登录</li>
              </ul>
            </div>
          </div>
          <p>
            同意<span>《服务条款》</span><span>《隐私政策》</span
            ><span>《儿童隐私政策》</span>
          </p>
        </div>
      </div>
      <div class="box" v-show="!isLogin">
        <div class="box_login">
          手机号登陆
          <span @click="change">x</span>
        </div>
        <div class="box_in1">
          <table>
            <tr>
              <td>
                <select id="quhao" width="">
                  <option value="1">+86</option>
                  <option value="1">+853</option>
                  <option value="1">+886</option>
                  <option value="1">+213</option>
                </select>
                <input type="text" placeholder="请输入手机号" />
              </td>
            </tr>
            <tr>
              <td>
                <input
                  type="text"
                  class="yanzheng"
                  placeholder="请输入验证码"
                />
                <button>获取验证码</button><span class="but">&nbsp;</span>
              </td>
            </tr>
            <tr>
              <td>
                <div class="denglu tanxing">
                  <span>密码登录</span>
                  <span>自动登陆</span>
                </div>
              </td>
            </tr>
            <tr>
              <td><div class="last">登陆</div></td>
            </tr>
          </table>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex';
export default {
  data() {
    return {
      isShow: true,
      isLogin: true

    }
  },
  methods: {
    changeShow() {
      this.isShow = !this.isShow
    },
    ...mapMutations(["change"])

  },
  computed: {
    ...mapState(["showLogin"])
  }
}
</script>
 
<style lang = "less" scoped>
@import "../assets/base.less";
.box_in1 {
  width: 220px;
  margin: 30px auto;
  .last {
    background: url(../assets/Phonelog.png) no-repeat 0 9999px;
    padding: 0 15px 0 20px;
    height: 100%;
    line-height: 31px;
    text-align: center;
    background-position: 0 -387px;
    width: 100%;
    color: #fff;
    font-size: 12px;
    border-radius: 2px;
  }
  .denglu {
    font-size: 12px;
    color: #666;
    span {
      display: inline-block;
      &:nth-of-type(1) {
        margin-right: 122px;
      }
    }
  }
  td {
    height: 30px;
    display: flex;
    justify-content: space-between;
    text-align: center;
    line-height: 30px;
    margin-bottom: 10px;
    .yanzheng {
      width: 136px;
      margin-right: 5px;
    }
    input {
      border: 1px solid #ccc;
      font-size: 12px;
      padding-left: 10px;
      box-sizing: border-box;
    }
    select {
      border: 1px solid #ccc;
    }
    button {
      display: inline-block;
      width: 74px;
      border: none;
      padding: 0 2px 0 7px;
      background: url(../assets/Phonelog.png) 0 -59px no-repeat;
      text-align: center;
      cursor: pointer;
      font-size: 12px;
    }
    .but {
      background: url(../assets/Phonelog.png) right -100px no-repeat;
    }
  }
}
.login_in {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  .box {
    border-radius: 2px;
    overflow: hidden;
    width: 528px;
    margin: 200px auto;
    background-color: #fff;
    .box_login {
      padding: 0 18px 0 18px;
      line-height: 39px;
      height: 39px;
      font-weight: bold;
      color: #fff;
      background: #2d2d2d;
      span {
        float: right;
        font-weight: normal;
        color: #999999;
        cursor: pointer;
      }
    }
    .box_in {
      padding: 10px 0;
      .chose {
        cursor: pointer;
        width: 118px;
        height: 28px;
        margin: 5px auto;
        margin-bottom: 10px;
        padding-right: 0;
        font-size: 12px;
        border: 1px solid #979797;
        border-radius: 15px;
        line-height: 28px;
        text-align: center;
        color: rgba(0, 0, 0, 0.8);
      }
      section {
        padding: 20px 60px;
        .weixin {
          text-align: center;
          h2 {
            font-weight: 500;
            font-size: 18px;
            margin-bottom: 10px;
          }
          p {
            margin-top: 10px;
            font-size: 12px;
            top: 181px;
            width: 200px;
            right: -15px;
            left: auto;
            line-height: 17px;
            color: rgba(0, 0, 0, 0.4);
            span {
              color: #0c73c2;
              cursor: pointer;
            }
          }
        }
      }
    }
    .user_phone {
      padding: 10px 30px;
      p {
        margin: 30px 0 20px 0;
        font-size: 12px;
        color: #ccc;
        span {
          cursor: pointer;
          color: #507daf;
        }
      }
      .user {
        .user_l {
          border-right: 1px dotted #ccc;
          width: 300px;
          padding: 0 30px 0 10px;
          box-sizing: border-box;
          .u_log {
            border-radius: 3px;
            width: 184px;
            background: url(../assets/Phonelog.png) no-repeat 0 224px;
            background-position: 0 -387px;
            padding: 0 15px 0 20px;
            height: 30px;
            line-height: 31px;
            text-align: center;
            font-size: 12px;
            color: #fff;
          }
          .u_get {
            border-radius: 3px;
            border-right: 1px solid #ccc;
            width: 184px;
            background: url(../assets/Phonelog.png) no-repeat 0 224px;
            padding: 0 15px 0 20px;
            height: 30px;
            line-height: 31px;
            text-align: center;
            background-position: 0 -59px;
            font-size: 12px;
            color: rgba(0, 0, 0, 0.8);
            margin: 10px 0;
          }
        }
        .user_r {
          color: #333;
          font-size: 12px;
          li {
            display: flex;
            line-height: 38px;
            margin-top: 10px;
            span {
              margin-right: 10px;
              display: block;
              width: 40px;
              height: 40px;
              background: url(../assets/logo.png) no-repeat;
              background-size: 38px;
              background-position: 0 0;
            }
            &:nth-of-type(2) span {
              background-position: 0 -48px;
            }
            &:nth-of-type(3) span {
              background-position: 0 -100px;
            }
            &:nth-of-type(4) span {
              background-position: 0 -151px;
            }
          }
        }
      }
    }
  }
}
</style>